<%@ tag language="java" pageEncoding="UTF-8"%>

<%@ attribute name="name" rtexprvalue="true" required="true"%>
<%@ attribute name="size" rtexprvalue="true"%>
<%@ attribute name="label" rtexprvalue="true"%>
<%@ attribute name="required" rtexprvalue="true"%>
<%@ attribute name="value" rtexprvalue="true"%>
<%@ attribute name="single" rtexprvalue="true"%>
<%@ attribute name="help" rtexprvalue="true"%>
<%@ attribute name="widget" rtexprvalue="true"%>
<%@ attribute name="onchange" rtexprvalue="true"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<c:if test="${size==null}">
	<c:set var="size" value="30"/>
</c:if>

<c:if test="${required==null}">
	<c:set var="required" value="false" />
</c:if>

<c:if test="${widget!=null}">
	<c:set var="name" value="${name}->${widget}" />
</c:if>

<c:choose>
	<c:when test="${single==null}">
		<c:set var="single" value="1" />
	</c:when>
	<c:when test="${single==1}">
		<c:set var="single" value="3" />
	</c:when>
	<c:otherwise>
		<c:set var="single" value="1" />
	</c:otherwise>
</c:choose>
<th>
	<c:if test="${required}"><label class="requireField">*</label></c:if>
	<label>${label}:</label>
</th>

<td colspan="${single}">
	<input type="text" name="${name}" maxlength="100" <c:if test="${onchange!=null}"> onchange="${onchange}"</c:if>
		class="formText" value="${value}" style="width: ${size}px;"/>${help}
</td>